<?php

use think\facade\Route;

// api接口无需token模块
Route::group('api', function () {
    Route::group('index', function () {
        Route::any('index', 'api.Index/index')->name('轮播图');
        Route::any('logo', 'api.Index/logo')->name('logo');
        Route::any('getNearbySchoolList', 'api.Index/getNearbySchoolList')->name('附近驾校');
        Route::any('getActiveList', 'api.Index/getActiveList')->name('热门活动');
        Route::any('getLocationInfo', 'api.Index/getLocationInfo')->name('位置信息');
        Route::any('getContent', 'api.Index/getContent')->name('获取富文本');
        Route::any('getAppId', 'api.Index/getAppId')->name('获取富文本');
        Route::any('getHint', 'api.Index/getHint')->name('获取温馨提示');
        Route::any('getServiceTel', 'api.Index/getServiceTel')->name('获取客服电话');
        Route::any('getVerifyCarIntroImg', 'api.Index/getVerifyCarIntroImg')->name('验车说明图');
    });
    Route::group('wx', function () {
        Route::any('getPhoneNumber', 'api.Wx/getPhoneNumber')->name('获取手机号');
        Route::any('getOpenId', 'api.Wx/getOpenId')->name('获取openid');
        Route::any('wxLogin', 'api.Wx/wxLogin')->name('微信登录');
        Route::any('echoStr', 'api.Wx/echoStr')->name('微信公众号验证');
    });
    Route::group('notify', function () {
        Route::any('verifyCartNotify', 'api.Notify/verifyCartNotify')->name('验车订单支付回调');
        Route::any('partnerDriveNotify', 'api.Notify/partnerDriveNotify')->name('陪驾订单支付回调');
        Route::any('studyCardNotify', 'api.Notify/studyCardNotify')->name('学车订单支付回调');
    });
    Route::group('sms', function () {
        Route::any('sendSms', 'api.common.Sms/sendSms')->name('发送短信');
    });
    Route::group('partnerDrive', function () {
        Route::any('banner', 'api.PartnerDrive/banner')->name('陪驾轮播图');
        Route::any('getOpenCityArr', 'api.PartnerDrive/getOpenCityArr')->name('开通城市');
        Route::any('getEscortMenuList', 'api.PartnerDrive/getEscortMenuList')->name('陪驾套餐列表');
    });
    // 学车
    Route::group('study', function () {
        Route::any('getOpenCityList', 'api.StudyCart/getOpenCityList')->name('开通城市');
        Route::any('getSchoolList', 'api.StudyCart/getSchoolList')->name('驾校列表');
        Route::any('getSchoolDetail', 'api.StudyCart/getSchoolDetail')->name('驾校详情');
        Route::any('getCourseList', 'api.StudyCart/getCourseList')->name('驾校课程');
        Route::any('getCourseDetail', 'api.StudyCart/getCourseDetail')->name('课程详情');
    });
    Route::group('testDrive', function () {
        Route::any('getTestDriveList', 'api.TestDrive/getTestDriveList')->name('试驾活动列表');
        Route::any('getTestDriveDetail', 'api.TestDrive/getTestDriveDetail')->name('试驾活动详情');
    });
})->allowCrossDomain();

// api接口模块
Route::group('api', function () {
    // 用户
    Route::group('user', function () {
        Route::any('getUserInfo', 'api.User/getUserInfo')->name('获取用户信息');
        Route::any('setUserInfo', 'api.User/setUserInfo')->name('设置用户信息');
        Route::any('getMoneyDetail', 'api.User/getMoneyDetail')->name('余额明细');
        Route::any('withdraw', 'api.User/withdraw')->name('提现');
        Route::any('getMyTeamList', 'api.User/getMyTeamList')->name('我的团队');
        Route::any('getUserQrcode', 'api.User/getUserQrcode')->name('我的二维码');
    });
    // 优惠券
    Route::group('coupon', function () {
        Route::any('getCouponList', 'api.Coupon/getCouponList')->name('首页优惠券弹窗');
        Route::any('sendCouponToUser', 'api.Coupon/sendCouponToUser')->name('领取优惠券');
        Route::any('getUserCouponList', 'api.Coupon/getUserCouponList')->name('获取优惠券列表');
    });
    // 试驾
    Route::group('testDrive', function () {
        Route::any('submitTestDriverOrder', 'api.TestDrive/submitTestDriverOrder')->name('试驾活动报名');
        Route::any('getOrderList', 'api.TestDrive/getOrderList')->name('试驾活动报名列表');
        Route::any('detail', 'api.TestDrive/detail')->name('试驾活动报名详情');
        Route::any('cancel', 'api.TestDrive/cancel')->name('试驾活动报名取消');
        Route::any('del', 'api.TestDrive/del')->name('试驾活动报名删除');
    });
    // 验车
    Route::group('verifyCart', function () {
        Route::any('getCatShapeList', 'api.VerifyCart/getCatShapeList')->name('获取车型列表');
        Route::any('getMenuList', 'api.VerifyCart/getMenuList')->name('获取套餐列表');
        Route::any('submitCart', 'api.VerifyCart/submitCart')->name('提交验车信息');
        Route::any('getVerifyCartOrderCouponList', 'api.VerifyCart/getVerifyCartOrderCouponList')->name('验车优惠券');
        Route::any('payVerifyCartOrder', 'api.VerifyCart/payVerifyCartOrder')->name('订单支付');
        Route::any('getOrderList', 'api.VerifyCart/getOrderList')->name('我的验车');
        Route::any('getOrderDetail', 'api.VerifyCart/getOrderDetail')->name('订单详情');
        Route::any('cancelOrder', 'api.VerifyCart/cancelOrder')->name('取消订单');
        Route::any('delOrder', 'api.VerifyCart/delOrder')->name('删除订单');
        Route::any('complaintOrder', 'api.VerifyCart/complaintOrder')->name('订单投诉');
        Route::any('result', 'api.VerifyCart/result')->name('验车结果');
        Route::any('completeOrder', 'api.VerifyCart/completeOrder')->name('完成订单');
    });
    // 陪驾
    Route::group('partnerDrive', function () {


        Route::any('getEscortMenuInfo', 'api.PartnerDrive/getEscortMenuInfo')->name('陪驾套餐详情');
        Route::any('createEscortMenuOrder', 'api.PartnerDrive/createEscortMenuOrder')->name('陪驾套餐购买');
        Route::any('getPartnerDriveOrderCouponList', 'api.PartnerDrive/getPartnerDriveOrderCouponList')->name('陪驾套餐可用优惠券');
        Route::any('payPartnerDriveOrder', 'api.PartnerDrive/payPartnerDriveOrder')->name('支付');
        Route::any('getMyPartnerDriveList', 'api.PartnerDrive/getMyPartnerDriveList')->name('我的陪驾套餐');
        Route::any('reserve', 'api.PartnerDrive/reserve')->name('预约');
        Route::any('getMyPartnerDriveReserveList', 'api.PartnerDrive/getMyPartnerDriveReserveList')->name('我的预约列表');
        Route::any('cancel', 'api.PartnerDrive/cancel')->name('取消我的预约');
        Route::any('getReserveInfo', 'api.PartnerDrive/getReserveInfo')->name('我的预约详情');
        Route::any('getAreaList', 'api.PartnerDrive/getAreaList')->name('区域列表');
        Route::any('getPartnerList', 'api.PartnerDrive/getPartnerList')->name('教练列表');
        Route::any('getPartnerDetail', 'api.PartnerDrive/getPartnerDetail')->name('教练详情');
        Route::any('getPartnerEvaList', 'api.PartnerDrive/getPartnerEvaList')->name('教练评价列表');
        Route::any('getCoachClassList', 'api.PartnerDrive/getCoachClassList')->name('课程表');
        Route::any('getExamineList', 'api.PartnerDrive/getExamineList')->name('检测题目');
        Route::any('submitUserExamine', 'api.PartnerDrive/submitUserExamine')->name('提交检测题目');
        Route::any('getUserExamineList', 'api.PartnerDrive/getUserExamineList')->name('历史测评');
        Route::any('evaluate', 'api.PartnerDrive/evaluate')->name('评价教练');
        Route::any('complete', 'api.PartnerDrive/complete')->name('完成订单');
        Route::any('modifyReserveTime', 'api.PartnerDrive/modifyReserveTime')->name('修改预约时间');
        Route::any('uploadCode', 'api.PartnerDrive/uploadCode')->name('上传券码');
        Route::any('getDutyList', 'api.PartnerDrive/getDutyList')->name('值班列表');
    });
    // 模拟考试
    Route::group('topic', function () {
        Route::any('index', 'api.Topic/index')->name('驾考首页');
        Route::any('getTopicList', 'api.Topic/getTopicList')->name('全部考题');
        Route::any('getErrorTopicList', 'api.Topic/getErrorTopicList')->name('全部错题');
        Route::any('getCollectTopicList', 'api.Topic/getCollectTopicList')->name('全部收藏');
        Route::any('getCollectTopicIdArr', 'api.Topic/getCollectTopicIdArr')->name('全部收藏题号');
        Route::any('getPracticeTestList', 'api.Topic/getPracticeTestList')->name('模拟试题');
        Route::any('submitTopic', 'api.Topic/submitTopic')->name('提交考试结果');
        Route::any('collect', 'api.Topic/collect')->name('收藏，取消收藏');
        Route::any('getVideoList', 'api.Topic/getVideoList')->name('视频列表');
        Route::any('studyVideo', 'api.Topic/studyVideo')->name('视频学习');
        Route::any('getHistoryScore', 'api.Topic/getHistoryScore')->name('历史成绩');
    });
    // 学车
    Route::group('study', function () {
        Route::any('createStudyOrder', 'api.StudyCart/createStudyOrder')->name('学车订单');
        Route::any('getPartnerDriveOrderCouponList', 'api.StudyCart/getPartnerDriveOrderCouponList')->name('订单可用优惠券');
        Route::any('payPartnerDriveOrder', 'api.StudyCart/payPartnerDriveOrder')->name('订单支付');
        Route::any('getMyStudyOrder', 'api.StudyCart/getMyStudyOrder')->name('学车订单');
        Route::any('complaintOrder', 'api.StudyCart/complaintOrder')->name('投诉');
        Route::any('completeOrder', 'api.StudyCart/completeOrder')->name('完成订单');
        Route::any('uploadCode', 'api.StudyCart/uploadCode')->name('上传券码');
    });
    // 文件上传
    Route::group('file', function () {
        Route::any('upload', 'api.File/upload')->name('文件上传');
    });
})->allowCrossDomain()->middleware('api_auth');
